package cc.rengu.igas.momp.biz.service.impl;

import cc.rengu.igas.momp.common.enums.MompTxnNumEnum;
import cc.rengu.igas.momp.common.enums.RespCodeEnum;
import cc.rengu.igas.momp.facade.QueryMcListInfoService;
import cc.rengu.igas.momp.facade.request.*;
import cc.rengu.igas.momp.facade.response.*;
import cc.rengu.igas.momp.facade.result.Result;
import cc.rengu.oltp.service.common.enums.OltpRpcdEnum;
import cc.rengu.oltp.service.model.BizException;
import cc.rengu.oltp.service.model.DubboResult;
import cc.rengu.oltp.service.realize.DubboService;
import cc.rengu.oltp.service.realize.impl.DubboServiceImpl;

/**
 * 营销活动列表信息查询接口实现
 *
 * @author Jinan Liu
 * @version 1.0.0
 * @date 2020/3/9 16:26
 */
@SuppressWarnings("unchecked")
public class QueryMcListInfoServiceImpl implements QueryMcListInfoService {

    /**
     * 代理商营销活动列表查询Dubbo实现
     *
     * @param queryAgentProfitSharingMcListInfoRequest 代理商分润营销活动列表查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryAgentProfitSharingMcListInfoResponse> 代理商营销活动列表查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 10:53
     */
    @Override
    public Result<QueryAgentProfitSharingMcListInfoResponse> queryAgentProfitSharingMcList(QueryAgentProfitSharingMcListInfoRequest queryAgentProfitSharingMcListInfoRequest) {

        DubboService<QueryAgentProfitSharingMcListInfoRequest> dubboService = new DubboServiceImpl();
        Result<QueryAgentProfitSharingMcListInfoResponse> queryAgentProfitSharingMcListInfoResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_APS_MC_LIST.getTxnNum().equals(queryAgentProfitSharingMcListInfoRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryAgentProfitSharingMcListInfoResponse> dubboResult = dubboService.callAtomService(queryAgentProfitSharingMcListInfoRequest,
                    MompTxnNumEnum.QUERY_APS_MC_LIST.getService(), QueryAgentProfitSharingMcListInfoResponse.class);
            queryAgentProfitSharingMcListInfoResponseResult.setResult(dubboResult.getResult());
            queryAgentProfitSharingMcListInfoResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryAgentProfitSharingMcListInfoResponse queryAgentProfitSharingMcListInfoResponse = new QueryAgentProfitSharingMcListInfoResponse();
            queryAgentProfitSharingMcListInfoResponseResult.setResult(queryAgentProfitSharingMcListInfoResponse);
            queryAgentProfitSharingMcListInfoResponse.setHeader(queryAgentProfitSharingMcListInfoRequest.getHeader());
            queryAgentProfitSharingMcListInfoResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryAgentProfitSharingMcListInfoResponse.setRespCode(((BizException) e).getCode());
                queryAgentProfitSharingMcListInfoResponse.setRespDesc(e.getMessage());
            } else {
                queryAgentProfitSharingMcListInfoResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryAgentProfitSharingMcListInfoResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }

        return queryAgentProfitSharingMcListInfoResponseResult;
    }

    /**
     * 收银员返现营销活动列表查询Dubbo实现
     *
     * @param queryCashierCashbackMcListInfoRequest 收银员返现营销活动列表查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryCashierCashbackMcListInfoResponse> 收银员返现营销活动列表查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 10:55
     */
    @Override
    public Result<QueryCashierCashbackMcListInfoResponse> queryCashierCashbackMcList(QueryCashierCashbackMcListInfoRequest queryCashierCashbackMcListInfoRequest) {

        DubboService<QueryCashierCashbackMcListInfoRequest> dubboService = new DubboServiceImpl();
        Result<QueryCashierCashbackMcListInfoResponse> queryCashierCashbackMcListInfoResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_CCB_MC_LIST.getTxnNum().equals(queryCashierCashbackMcListInfoRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryCashierCashbackMcListInfoResponse> dubboResult = dubboService.callAtomService(queryCashierCashbackMcListInfoRequest,
                    MompTxnNumEnum.QUERY_CCB_MC_LIST.getService(), QueryCashierCashbackMcListInfoResponse.class);
            queryCashierCashbackMcListInfoResponseResult.setResult(dubboResult.getResult());
            queryCashierCashbackMcListInfoResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryCashierCashbackMcListInfoResponse queryCashierCashbackMcListInfoResponse = new QueryCashierCashbackMcListInfoResponse();
            queryCashierCashbackMcListInfoResponseResult.setResult(queryCashierCashbackMcListInfoResponse);
            queryCashierCashbackMcListInfoResponse.setHeader(queryCashierCashbackMcListInfoRequest.getHeader());
            queryCashierCashbackMcListInfoResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryCashierCashbackMcListInfoResponse.setRespCode(((BizException) e).getCode());
                queryCashierCashbackMcListInfoResponse.setRespDesc(e.getMessage());
            } else {
                queryCashierCashbackMcListInfoResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryCashierCashbackMcListInfoResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryCashierCashbackMcListInfoResponseResult;
    }

    /**
     * 卡券营销活动列表查询Dubbo实现
     *
     * @param queryCouponMcListInfoRequest 卡券营销活动列表查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryCouponMcListInfoResponse> 卡券类营销活动列表查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 10:57
     */
    @Override
    public Result<QueryCouponMcListInfoResponse> queryCouponMcList(QueryCouponMcListInfoRequest queryCouponMcListInfoRequest) {

        DubboService<QueryCouponMcListInfoRequest> dubboService = new DubboServiceImpl();
        Result<QueryCouponMcListInfoResponse> queryCouponMcListInfoResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_CP_MC_LIST.getTxnNum().equals(queryCouponMcListInfoRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryCouponMcListInfoResponse> dubboResult = dubboService.callAtomService(queryCouponMcListInfoRequest,
                    MompTxnNumEnum.QUERY_CP_MC_LIST.getService(), QueryCouponMcListInfoResponse.class);
            queryCouponMcListInfoResponseResult.setResult(dubboResult.getResult());
            queryCouponMcListInfoResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryCouponMcListInfoResponse queryCouponMcListInfoResponse = new QueryCouponMcListInfoResponse();
            queryCouponMcListInfoResponseResult.setResult(queryCouponMcListInfoResponse);
            queryCouponMcListInfoResponse.setHeader(queryCouponMcListInfoRequest.getHeader());
            queryCouponMcListInfoResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryCouponMcListInfoResponse.setRespCode(((BizException) e).getCode());
                queryCouponMcListInfoResponse.setRespDesc(e.getMessage());
            } else {
                queryCouponMcListInfoResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryCouponMcListInfoResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryCouponMcListInfoResponseResult;
    }

    /**
     * 商户手续费优惠营销活动列表查询Dubbo实现
     *
     * @param queryMchntFeeDiscountMcListInfoRequest 商户手续费优惠营销活动列表查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryMchntFeeDiscountMcListInfoResponse> 商户手续费优惠营销活动列表查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 10:59
     */
    @Override
    public Result<QueryMchntFeeDiscountMcListInfoResponse> queryMchntFeeDiscountMcList(QueryMchntFeeDiscountMcListInfoRequest queryMchntFeeDiscountMcListInfoRequest) {

        DubboService<QueryMchntFeeDiscountMcListInfoRequest> dubboService = new DubboServiceImpl();
        Result<QueryMchntFeeDiscountMcListInfoResponse> queryMchntFeeDiscountMcListInfoResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_MFD_MC_LIST.getTxnNum().equals(queryMchntFeeDiscountMcListInfoRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryMchntFeeDiscountMcListInfoResponse> dubboResult = dubboService.callAtomService(queryMchntFeeDiscountMcListInfoRequest,
                    MompTxnNumEnum.QUERY_MFD_MC_LIST.getService(), QueryMchntFeeDiscountMcListInfoResponse.class);
            queryMchntFeeDiscountMcListInfoResponseResult.setResult(dubboResult.getResult());
            queryMchntFeeDiscountMcListInfoResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryMchntFeeDiscountMcListInfoResponse queryMchntFeeDiscountMcListInfoResponse = new QueryMchntFeeDiscountMcListInfoResponse();
            queryMchntFeeDiscountMcListInfoResponseResult.setResult(queryMchntFeeDiscountMcListInfoResponse);
            queryMchntFeeDiscountMcListInfoResponse.setHeader(queryMchntFeeDiscountMcListInfoRequest.getHeader());
            queryMchntFeeDiscountMcListInfoResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryMchntFeeDiscountMcListInfoResponse.setRespCode(((BizException) e).getCode());
                queryMchntFeeDiscountMcListInfoResponse.setRespDesc(e.getMessage());
            } else {
                queryMchntFeeDiscountMcListInfoResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryMchntFeeDiscountMcListInfoResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryMchntFeeDiscountMcListInfoResponseResult;
    }

    /**
     * 减免类活动列表查询Dubbo接口实现
     *
     * @param queryMoneyOffMcListInfoRequest 减免类活动列表查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryMoneyOffMcListInfoResponse> 减免类营销活动列表查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 10:52
     */
    @Override
    public Result<QueryMoneyOffMcListInfoResponse> queryMoneyOffMcList(QueryMoneyOffMcListInfoRequest queryMoneyOffMcListInfoRequest) {

        DubboService<QueryMoneyOffMcListInfoRequest> dubboService = new DubboServiceImpl();
        Result<QueryMoneyOffMcListInfoResponse> queryMoneyOffMcListInfoResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_MO_MC_LIST.getTxnNum().equals(queryMoneyOffMcListInfoRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryMoneyOffMcListInfoResponse> dubboResult = dubboService.callAtomService(queryMoneyOffMcListInfoRequest,
                    MompTxnNumEnum.QUERY_MO_MC_LIST.getService(), QueryMoneyOffMcListInfoResponse.class);
            queryMoneyOffMcListInfoResponseResult.setResult(dubboResult.getResult());
            queryMoneyOffMcListInfoResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryMoneyOffMcListInfoResponse queryMoneyOffMcListInfoResponse = new QueryMoneyOffMcListInfoResponse();
            queryMoneyOffMcListInfoResponseResult.setResult(queryMoneyOffMcListInfoResponse);
            queryMoneyOffMcListInfoResponse.setHeader(queryMoneyOffMcListInfoRequest.getHeader());
            queryMoneyOffMcListInfoResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryMoneyOffMcListInfoResponse.setRespCode(((BizException) e).getCode());
                queryMoneyOffMcListInfoResponse.setRespDesc(e.getMessage());
            } else {
                queryMoneyOffMcListInfoResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryMoneyOffMcListInfoResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryMoneyOffMcListInfoResponseResult;
    }

    /**
     * 营销活动列表查询Dubbo实现
     *
     * @param queryMcListInfoRequest 营销活动列表查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryMcListInfoResponse> 营销活动列表查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 11:02
     */
    @Override
    public Result<QueryMcListInfoResponse> queryMcList(QueryMcListInfoRequest queryMcListInfoRequest) {

        DubboService<QueryMcListInfoRequest> dubboService = new DubboServiceImpl();
        Result<QueryMcListInfoResponse> queryMcListInfoResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_MC_LIST.getTxnNum().equals(queryMcListInfoRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryMcListInfoResponse> dubboResult = dubboService.callAtomService(queryMcListInfoRequest,
                    MompTxnNumEnum.QUERY_MC_LIST.getService(), QueryMcListInfoResponse.class);
            queryMcListInfoResponseResult.setResult(dubboResult.getResult());
            queryMcListInfoResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryMcListInfoResponse queryMcListInfoResponse = new QueryMcListInfoResponse();
            queryMcListInfoResponseResult.setResult(queryMcListInfoResponse);
            queryMcListInfoResponse.setHeader(queryMcListInfoRequest.getHeader());
            queryMcListInfoResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryMcListInfoResponse.setRespCode(((BizException) e).getCode());
                queryMcListInfoResponse.setRespDesc(e.getMessage());
            } else {
                queryMcListInfoResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryMcListInfoResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryMcListInfoResponseResult;
    }

    /**
     * 收银员返现活动明细列表查询Dubbo实现
     *
     * @param cashierMcCashbackDetailRequest 收银员返现活动明细列表查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryCashbackToCashierDetailResponse> 收银员返现活动明细列表查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 11:02
     */
    @Override
    public Result<CashierMcCashbackDetailResponse> queryCashierMcCashbackDetail(CashierMcCashbackDetailRequest cashierMcCashbackDetailRequest) {

        DubboService<CashierMcCashbackDetailRequest> dubboService = new DubboServiceImpl();
        Result<CashierMcCashbackDetailResponse> cashierMcCashbackDetailResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_CASHIER_CASHBACK_DETAIL.getTxnNum().equals(cashierMcCashbackDetailRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<CashierMcCashbackDetailResponse> dubboResult = dubboService.callAtomService(cashierMcCashbackDetailRequest,
                    MompTxnNumEnum.QUERY_CASHIER_CASHBACK_DETAIL.getService(), CashierMcCashbackDetailResponse.class);
            cashierMcCashbackDetailResponseResult.setResult(dubboResult.getResult());
            cashierMcCashbackDetailResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            CashierMcCashbackDetailResponse cashierMcCashbackDetailResponse = new CashierMcCashbackDetailResponse();
            cashierMcCashbackDetailResponseResult.setResult(cashierMcCashbackDetailResponse);
            cashierMcCashbackDetailResponse.setHeader(cashierMcCashbackDetailRequest.getHeader());
            cashierMcCashbackDetailResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                cashierMcCashbackDetailResponse.setRespCode(((BizException) e).getCode());
                cashierMcCashbackDetailResponse.setRespDesc(e.getMessage());
            } else {
                cashierMcCashbackDetailResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                cashierMcCashbackDetailResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return cashierMcCashbackDetailResponseResult;
    }

    /**
     * 收银员返现积分规则查询Dubbo实现
     *
     * @param queryCashierCashbackBonusRuleRequest 收银员返现积分规则查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryCashierCashbackBonusRuleResponse> 收银员返现积分规则查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 11:02
     */
    @Override
    public Result<QueryCashierCashbackBonusRuleResponse> queryCashierCashbackBonusRule(QueryCashierCashbackBonusRuleRequest queryCashierCashbackBonusRuleRequest) {

        DubboService<QueryCashierCashbackBonusRuleRequest> dubboService = new DubboServiceImpl();
        Result<QueryCashierCashbackBonusRuleResponse> queryCashierCashbackBonusRuleResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.CASHIER_CASHBACK_BONUS_RULE_QUERY.getTxnNum().equals(queryCashierCashbackBonusRuleRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryCashierCashbackBonusRuleResponse> dubboResult = dubboService.callAtomService(queryCashierCashbackBonusRuleRequest,
                    MompTxnNumEnum.CASHIER_CASHBACK_BONUS_RULE_QUERY.getService(), QueryCashierCashbackBonusRuleResponse.class);
            queryCashierCashbackBonusRuleResponseResult.setResult(dubboResult.getResult());
            queryCashierCashbackBonusRuleResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryCashierCashbackBonusRuleResponse queryCashierCashbackBonusRuleResponse = new QueryCashierCashbackBonusRuleResponse();
            queryCashierCashbackBonusRuleResponseResult.setResult(queryCashierCashbackBonusRuleResponse);
            queryCashierCashbackBonusRuleResponse.setHeader(queryCashierCashbackBonusRuleRequest.getHeader());
            queryCashierCashbackBonusRuleResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryCashierCashbackBonusRuleResponse.setRespCode(((BizException) e).getCode());
                queryCashierCashbackBonusRuleResponse.setRespDesc(e.getMessage());
            } else {
                queryCashierCashbackBonusRuleResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryCashierCashbackBonusRuleResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryCashierCashbackBonusRuleResponseResult;
    }

    /**
     * 法人机构营销活动账号查询Dubbo实现
     *
     * @param queryInstitutionMcAccountInfoRequest 法人机构营销活动账号查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryCashbackToCashierDetailResponse> 法人机构营销活动账号查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 11:02
     */
    @Override
    public Result<QueryInstitutionMcAccountInfoResponse> queryInstitutionMcAccountInfo(QueryInstitutionMcAccountInfoRequest queryInstitutionMcAccountInfoRequest) {

        DubboService<QueryInstitutionMcAccountInfoRequest> dubboService = new DubboServiceImpl();
        Result<QueryInstitutionMcAccountInfoResponse> queryInstitutionMcAccountInfoResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_INSTITUTION_MC_ACCOUNT.getTxnNum().equals(queryInstitutionMcAccountInfoRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryInstitutionMcAccountInfoResponse> dubboResult = dubboService.callAtomService(queryInstitutionMcAccountInfoRequest,
                    MompTxnNumEnum.QUERY_INSTITUTION_MC_ACCOUNT.getService(), QueryInstitutionMcAccountInfoResponse.class);
            queryInstitutionMcAccountInfoResponseResult.setResult(dubboResult.getResult());
            queryInstitutionMcAccountInfoResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryInstitutionMcAccountInfoResponse queryInstitutionMcAccountInfoResponse = new QueryInstitutionMcAccountInfoResponse();
            queryInstitutionMcAccountInfoResponseResult.setResult(queryInstitutionMcAccountInfoResponse);
            queryInstitutionMcAccountInfoResponse.setHeader(queryInstitutionMcAccountInfoRequest.getHeader());
            queryInstitutionMcAccountInfoResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryInstitutionMcAccountInfoResponse.setRespCode(((BizException) e).getCode());
                queryInstitutionMcAccountInfoResponse.setRespDesc(e.getMessage());
            } else {
                queryInstitutionMcAccountInfoResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryInstitutionMcAccountInfoResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryInstitutionMcAccountInfoResponseResult;
    }

    /**
     * 收银员参与收银员返现活动Dubbo实现
     *
     * @param cashierJoinCashierCashBackRequest 收银员参与收银员返现活动接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.CashierJoinCashierCashBackResponse> 收银员参与收银员返现活动接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 11:02
     */
    @Override
    public Result<CashierJoinCashierCashBackResponse> cashierJoinCashierBack(CashierJoinCashierCashBackRequest cashierJoinCashierCashBackRequest) {

        DubboService<CashierJoinCashierCashBackRequest> dubboService = new DubboServiceImpl();
        Result<CashierJoinCashierCashBackResponse> cashierJoinCashierCashBackResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.CASHIER_JOIN_CASHIER_CASHBACK_MC.getTxnNum().equals(cashierJoinCashierCashBackRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<CashierJoinCashierCashBackResponse> dubboResult = dubboService.callAtomService(cashierJoinCashierCashBackRequest,
                    MompTxnNumEnum.CASHIER_JOIN_CASHIER_CASHBACK_MC.getService(), CashierJoinCashierCashBackResponse.class);
            cashierJoinCashierCashBackResponseResult.setResult(dubboResult.getResult());
            cashierJoinCashierCashBackResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            CashierJoinCashierCashBackResponse cashierJoinCashierCashBackResponse = new CashierJoinCashierCashBackResponse();
            cashierJoinCashierCashBackResponseResult.setResult(cashierJoinCashierCashBackResponse);
            cashierJoinCashierCashBackResponse.setHeader(cashierJoinCashierCashBackRequest.getHeader());
            cashierJoinCashierCashBackResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                cashierJoinCashierCashBackResponse.setRespCode(((BizException) e).getCode());
                cashierJoinCashierCashBackResponse.setRespDesc(e.getMessage());
            } else {
                cashierJoinCashierCashBackResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                cashierJoinCashierCashBackResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return cashierJoinCashierCashBackResponseResult;
    }

    /**
     * 收银员信息查询Dubbo实现
     *
     * @param queryCashierInfoRequest 收银员信息查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.CashierJoinCashierCashBackResponse>收银员信息查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 11:02
     */
    @Override
    public Result<QueryCashierInfoResponse> queryCashierInfo(QueryCashierInfoRequest queryCashierInfoRequest) {

        DubboService<QueryCashierInfoRequest> dubboService = new DubboServiceImpl();
        Result<QueryCashierInfoResponse> queryCashierInfoResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_CASHIER_INFO.getTxnNum().equals(queryCashierInfoRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryCashierInfoResponse> dubboResult = dubboService.callAtomService(queryCashierInfoRequest,
                    MompTxnNumEnum.QUERY_CASHIER_INFO.getService(), QueryCashierInfoResponse.class);
            queryCashierInfoResponseResult.setResult(dubboResult.getResult());
            queryCashierInfoResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryCashierInfoResponse queryCashierInfoResponse = new QueryCashierInfoResponse();
            queryCashierInfoResponseResult.setResult(queryCashierInfoResponse);
            queryCashierInfoResponse.setHeader(queryCashierInfoRequest.getHeader());
            queryCashierInfoResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryCashierInfoResponse.setRespCode(((BizException) e).getCode());
                queryCashierInfoResponse.setRespDesc(e.getMessage());
            } else {
                queryCashierInfoResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryCashierInfoResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryCashierInfoResponseResult;
    }

    /**
     * 收银员活动返现明细查询Dubbo实现
     *
     * @param queryCashbackToCashierDetailRequest 收银员活动返现明细查询接口请求对象
     * @return cc.rengu.igas.momp.facade.result.Result<cc.rengu.igas.momp.facade.response.QueryCashbackToCashierDetailResponse>收银员活动返现明细查询接口应答对象
     * @author Jinan Liu
     * @date 2020/5/22 11:02
     */
    @Override
    public Result<QueryCashbackToCashierDetailResponse> queryCashbackToCashierDetail(QueryCashbackToCashierDetailRequest queryCashbackToCashierDetailRequest) {

        DubboService<QueryCashbackToCashierDetailRequest> dubboService = new DubboServiceImpl();
        Result<QueryCashbackToCashierDetailResponse> queryCashbackToCashierDetailResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_CASHIER_CASHBACK_DETAIL_BY_BANK.getTxnNum().equals(queryCashbackToCashierDetailRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryCashbackToCashierDetailResponse> dubboResult = dubboService.callAtomService(queryCashbackToCashierDetailRequest,
                    MompTxnNumEnum.QUERY_CASHIER_CASHBACK_DETAIL_BY_BANK.getService(), QueryCashbackToCashierDetailResponse.class);
            queryCashbackToCashierDetailResponseResult.setResult(dubboResult.getResult());
            queryCashbackToCashierDetailResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryCashbackToCashierDetailResponse queryCashbackToCashierDetailResponse = new QueryCashbackToCashierDetailResponse();
            queryCashbackToCashierDetailResponseResult.setResult(queryCashbackToCashierDetailResponse);
            queryCashbackToCashierDetailResponse.setHeader(queryCashbackToCashierDetailRequest.getHeader());
            queryCashbackToCashierDetailResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryCashbackToCashierDetailResponse.setRespCode(((BizException) e).getCode());
                queryCashbackToCashierDetailResponse.setRespDesc(e.getMessage());
            } else {
                queryCashbackToCashierDetailResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryCashbackToCashierDetailResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryCashbackToCashierDetailResponseResult;
    }

    @Override
    public Result<QueryMchntJoinMchntFeeDiscountResponse> queryMchntJoinMchntFeeDiscount(QueryMchntJoinMchntFeeDiscountRequest queryMchntJoinMchntFeeDiscountRequest) {

        DubboService<QueryMchntJoinMchntFeeDiscountRequest> dubboService = new DubboServiceImpl();

        Result<QueryMchntJoinMchntFeeDiscountResponse> queryMchntJoinMchntFeeDiscountResponseResponseResult = new Result<>();
        try {
            if (!MompTxnNumEnum.QUERY_MCHNT_JOIN_MCHNT_FEE_DISCOUNT.getTxnNum().equals(queryMchntJoinMchntFeeDiscountRequest.getHeader().getTxnNum())) {
                throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
            }
            // 通过服务名调用相应的服务
            DubboResult<QueryMchntJoinMchntFeeDiscountResponse> dubboResult = dubboService.callAtomService(queryMchntJoinMchntFeeDiscountRequest,
                    MompTxnNumEnum.QUERY_MCHNT_JOIN_MCHNT_FEE_DISCOUNT.getService(), QueryMchntJoinMchntFeeDiscountResponse.class);
            queryMchntJoinMchntFeeDiscountResponseResponseResult.setResult(dubboResult.getResult());
            queryMchntJoinMchntFeeDiscountResponseResponseResult.setSuccess(dubboResult.isSuccess());

        } catch (Exception e) {

            QueryMchntJoinMchntFeeDiscountResponse queryMchntJoinMchntFeeDiscountResponse = new QueryMchntJoinMchntFeeDiscountResponse();
            queryMchntJoinMchntFeeDiscountResponseResponseResult.setResult(queryMchntJoinMchntFeeDiscountResponse);
            queryMchntJoinMchntFeeDiscountResponse.setHeader(queryMchntJoinMchntFeeDiscountRequest.getHeader());
            queryMchntJoinMchntFeeDiscountResponseResponseResult.setSuccess(false);
            if (e instanceof BizException) {
                queryMchntJoinMchntFeeDiscountResponse.setRespCode(((BizException) e).getCode());
                queryMchntJoinMchntFeeDiscountResponse.setRespDesc(e.getMessage());
            } else {
                queryMchntJoinMchntFeeDiscountResponse.setRespCode(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespCode());
                queryMchntJoinMchntFeeDiscountResponse.setRespDesc(OltpRpcdEnum.OLTP_PROCESS_ERROR.getRespDesc());
            }
        }


        return queryMchntJoinMchntFeeDiscountResponseResponseResult;
    }

}
